package com.atguigu.reflect.testconstructor;

import java.lang.reflect.Constructor;

//测试调用构造方法
public class TestMain {
    public static void main(String[] args) throws Exception {
        Class clazz = Person.class;
        Constructor con = clazz.getConstructor(String.class);
        con.setAccessible(true);
        Person person = (Person) con.newInstance("name");
        System.out.println(person);


    }
}
